/**********************************************************************
 *@Project： CloudTest
 *@File: Dict
 *@Date: 2017/3/3
 *@Copyright (C) 2013-2017 http://www.posun.cn. All Rights Reserved.
 ***********************************************************************
 *注意： 本内容仅限于深圳市普盛实业有限公司内部使用，禁止外泄
 **********************************************************************
 */
package com.posun.edu.system.entity;

import com.posun.framework.orm.annotation.Column;
import com.posun.framework.orm.annotation.EntityListeners;
import com.posun.framework.orm.annotation.Id;
import com.posun.framework.orm.annotation.LogicDelete;
import com.posun.framework.orm.annotation.Table;
import com.posun.framework.orm.annotation.Version;
import com.posun.framework.orm.entity.AbstractEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldIndex;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;

/**
 * <p>
 * TODO<br>
 *
 * @author YL
 * @version 1.0
 * @createTime 2017/3/3 11:49
 * @ChangeLog
 */

/***
 * Document注解说明
 * indexName：索引库的名称，建议以项目的名称命名
 * type：类型，建议以实体的名称命名
 * shards：默认分区数
 * replicas：每个分区默认的备份数
 * refreshInterval：刷新间隔
 * indexStoreType：索引文件存储类型
 */

/**
 * Field注解说明
 * type：属性类型，默认为AUTO：自动检测属性的类型
 * index：是否分词，默认情况下分词
 * format：日期格式
 * pattern：正则表达式
 * store：存储原文，默认情况下不存储原文
 * searchAnalyzer：指定字段搜索时使用的分词器
 * indexAnalyzer：指定字段建立索引时指定的分词器
 * ignoreFields：如果某个字段需要被忽略
 */
@LogicDelete
@Table(value = "sys_dict")
@ApiModel(value = "数据字典")
@EntityListeners({EntityListener.class})
@Document(indexName = "aresdemo", type = "dict")
public class Dict extends AbstractEntity {

    @Id
    @Column(value = "RECORD_ID")
    private String id;

    @ApiModelProperty(value = "字典名称")
    @Column(value = "DICT_NAME")
    @Field(type = FieldType.String, store = true)
    private String dictName;

    @ApiModelProperty(value = "是否内置字典", allowableValues = "Y,N", example = "Y/N")
    @Column(value = "SYS_DICT")
    private String sysDict;

    @ApiModelProperty(value = "备注")
    @Column(value = "REMARK")
    private String remark;

    private String deleteEmpName;

    private String deleteEmp;

    @Field(format = DateFormat.date_time, index = FieldIndex.no, store = true, type = FieldType.Date)
    private LocalDateTime deleteTime;

    private int serverFlag;

    @Version
    private int version;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDictName() {
        return dictName;
    }

    public Dict setDictName(String dictName) {
        this.dictName = dictName;
        return this;
    }

    public String getSysDict() {
        return sysDict;
    }

    public Dict setSysDict(String sysDict) {
        this.sysDict = sysDict;
        return this;
    }

    public String getRemark() {
        return remark;
    }

    public Dict setRemark(String remark) {
        this.remark = remark;
        return this;
    }

    public String getDeleteEmpName() {
        return deleteEmpName;
    }

    public void setDeleteEmpName(String deleteEmpName) {
        this.deleteEmpName = deleteEmpName;
    }

    public String getDeleteEmp() {
        return deleteEmp;
    }

    public void setDeleteEmp(String deleteEmp) {
        this.deleteEmp = deleteEmp;
    }

    public LocalDateTime getDeleteTime() {
        return deleteTime;
    }

    public void setDeleteTime(LocalDateTime deleteTime) {
        this.deleteTime = deleteTime;
    }

    public int getServerFlag() {
        return serverFlag;
    }

    public void setServerFlag(int serverFlag) {
        this.serverFlag = serverFlag;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }
}
